A practical introduction
18/02/2026
.git folder that contains all the file history87c0c975daf0643d59a01222b312662d347e0bfa87c0c97Can we not make a google docs for code?
The process makes the user decide…
Pull - Modify - Stage - Commit - Push
github.comCommit (with a message)
Push
.gitignore file*.Rproj on a new line
.gitignoreA practical overview of the repository, in markdown format
Create a new branch “dev” in your repository
Make some changes to a file
Stage, commit, push
Switch between branches
library(readxl)
library(ggplot2)
sessions_file <- "example_sessions.csv"
min_sleep_period <- 2 # hours
file_ext <- tolower(file_ext(sessions_file))
if (file_ext == "csv") {
sessions <- read.csv(sessions_file)
} else if (file_ext %in% c("xls", "xlsx")) {
sessions <- read_excel(sessions_file) |>
as.data.frame()
}
sessions <- sessions[sessions['sleep_period'] >= min_sleep_period * 60 * 60, ]
p <- ggplot(sessions, aes(x = .data$night, y = .data$variable, color = .data$color_group)) +
geom_point(size = 5) +
color_scale +
labs(x = NULL, y = variable, color = NULL) +
theme_minimal(base_size = 16) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
print(p)load_data”, “set_ema_period”dev branchFunction template:
…commit and push your changes to github
On github, create a pull request to merge dev into main.